package com.cj.mobile.iabp.mvp.model.entity;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * @ProjectName: AptitudeAndroid
 * @Package: com.cj.mobile.iabp.mvp.model.entity
 * @ClassName: StoreInfo
 * @Description: 店铺信息
 * @Author: WLY
 * @CreateDate: 2022/9/19 17:17
 */
public class StoreInfo implements Parcelable,Cloneable {
    public StoreInfo(String storeId, String storeName, String storeMobile, String releaseTime, List<StoreModelInfo> modelList) {
        this.storeId = storeId;
        this.storeName = storeName;
        this.storeMobile = storeMobile;
        this.releaseTime = releaseTime;
        this.modelList = modelList;
    }

    public StoreInfo(String storeId, String storeName, List<StoreModelInfo> modelList) {
        this.storeId = storeId;
        this.storeName = storeName;
        this.modelList = modelList;
    }

    public StoreInfo() {
    }

    public StoreInfo(String storeId, String storeName, String storeMobile, String contact) {
        this.storeId = storeId;
        this.storeName = storeName;
        this.storeMobile = storeMobile;
        this.contact = contact;
    }

    // 店铺id
    private String storeId;
    // 店铺名称
    private String storeName;
    // 店铺电话
    private String storeMobile;
    // 发布时间
    private String releaseTime;
    // 地址
    private String address;
    // 货物照片
    private String imgUrl;
    // 型号
    private List<StoreModelInfo> modelList;

    // 订单号
    private String orderNo;
    // 重量
    private double weight;
    // 负责人
    private String contact;
    // 距离
    private double distance;

    public String getContact() {
        return contact;
    }

    public void setContact(String contact) {
        this.contact = contact;
    }

    public String getStoreId() {
        return storeId;
    }

    public void setStoreId(String storeId) {
        this.storeId = storeId;
    }

    public String getStoreName() {
        return storeName;
    }

    public void setStoreName(String storeName) {
        this.storeName = storeName;
    }

    public String getStoreMobile() {
        return storeMobile;
    }

    public void setStoreMobile(String storeMobile) {
        this.storeMobile = storeMobile;
    }

    public String getReleaseTime() {
        return releaseTime;
    }

    public void setReleaseTime(String releaseTime) {
        this.releaseTime = releaseTime;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public List<StoreModelInfo> getModelList() {
        return modelList;
    }

    public void setModelList(List<StoreModelInfo> modelList) {
        this.modelList = modelList;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public double getWeight() {
        return weight;
    }

    public void setWeight(double weight) {
        this.weight = weight;
    }

    public double getDistance() {
        return distance;
    }

    public void setDistance(double distance) {
        this.distance = distance;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.storeId);
        dest.writeString(this.storeName);
        dest.writeString(this.storeMobile);
        dest.writeString(this.releaseTime);
        dest.writeString(this.address);
        dest.writeString(this.imgUrl);
        dest.writeTypedList(this.modelList);
        dest.writeString(this.orderNo);
        dest.writeDouble(this.weight);
        dest.writeString(this.contact);
        dest.writeDouble(this.distance);
    }

    public void readFromParcel(Parcel source) {
        this.storeId = source.readString();
        this.storeName = source.readString();
        this.storeMobile = source.readString();
        this.releaseTime = source.readString();
        this.address = source.readString();
        this.imgUrl = source.readString();
        this.modelList = source.createTypedArrayList(StoreModelInfo.CREATOR);
        this.orderNo = source.readString();
        this.weight = source.readDouble();
        this.contact = source.readString();
        this.distance = source.readDouble();
    }

    protected StoreInfo(Parcel in) {
        this.storeId = in.readString();
        this.storeName = in.readString();
        this.storeMobile = in.readString();
        this.releaseTime = in.readString();
        this.address = in.readString();
        this.imgUrl = in.readString();
        this.modelList = in.createTypedArrayList(StoreModelInfo.CREATOR);
        this.orderNo = in.readString();
        this.weight = in.readDouble();
        this.contact = in.readString();
        this.distance = in.readDouble();
    }

    public static final Creator<StoreInfo> CREATOR = new Creator<StoreInfo>() {
        @Override
        public StoreInfo createFromParcel(Parcel source) {
            return new StoreInfo(source);
        }

        @Override
        public StoreInfo[] newArray(int size) {
            return new StoreInfo[size];
        }
    };

    @Override
    public StoreInfo clone() {
        try {
            StoreInfo clone = (StoreInfo) super.clone();
            // TODO: copy mutable state here, so the clone can't change the internals of the original
            return clone;
        } catch (CloneNotSupportedException e) {
            throw new AssertionError();
        }
    }
}
